package com.abe.jmcl.adapter;


import android.content.Context;
import android.view.View;
import android.view.ViewGroup;

import com.abe.jmcl.R;
import com.abeframe.core.libs.adapter.BaseXApapter;
import com.abeframe.core.libs.adapter.CommonData;
import com.abeframe.core.libs.adapter.autobase.ViewHolderUtils;

import java.util.List;

public class WidgetCommonAdapter extends BaseXApapter {

    public static final String TYPE_ACTIONSHEET = "TYPE_ACTIONSHEET";

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        CommonData temData = data.get(i);
        switch (temData.getType()) {
            case TYPE_ACTIONSHEET: {
                view = inflater
                        .inflate(R.layout.item_list_text_normal,
                                viewGroup, false);
                ViewHolderUtils.ViewHolder holder = vh.get(view);
                String entity = ((String) temData.getData());
                if (entity != null) {
                    holder.getTextView(R.id.item_name).setText(entity);
                }
            }
            break;
        }
        return view;
    }

    public WidgetCommonAdapter(Context context, List<CommonData> data) {
        super(context, data);
    }
}
